package com.foreknow.demo4;

public class ObjectArray {
    public static void main(String[] args) {
        Person[] person = new Person[3];
        Person p1 = new Person();
        p1.name = "fender";
        Person p2 = new Person();
        p2.name = "gibson";
        Person p3 = new Person();
        p3.name = "yamaha";
        person[0] = p1;
        person[1] = p2;
        person[2] = p3;
        for (int i = 0;i<person.length;i++){
            Person p = person[i];
            System.out.println(p.name);
        }
    }
}
